$(function () {
    //柱形图
    var per_width = $('.chart').width();
    $('.contrastList li').each(function () {
        var now_data = parseFloat($(this).find('.pillar>.sameDay>span').text().replace('%', '').replace('￥', '').replace('元',''));

        var chart_width = $(this).find('.chart').width();
        var now_data_width = now_data % (chart_width * 0.5);
        $(this).find('.pillar>.sameDay>.line').width(now_data_width);

        var last_week_data = parseFloat($(this).find('.pillar>.lastWeek>span').text().replace('%', '').replace('￥', '').replace('元',''));

        var last_week_data_width = last_week_data % (chart_width * 0.5);;
        $(this).find('.average>span').text((now_data-last_week_data).toFixed(2));
        console.log(now_data-last_week_data);
        var w2 = parseFloat($(this).find('.average>span').text().replace('%', '').replace('￥', '').replace('元',''));
        console.log(now_data);
        console.log(w2);
        $(this).find('.average>span').text();


        $(this).find('.pillar>.lastWeek>.line').width(last_week_data_width);
    });
    //等高
    $('#paid').height($('.paid>.right').height());
    $('#sale').height($('.sale>.right').height());

    //popup 更新品牌门店,

    $('.selectedStore').click(function () {
        $('.popupBox').show();
    });
    $('.popupBg').click(function () {
        $('.popupBox').hide();
    })

    //等高
    $('.cont').innerHeight($(window).height() - $('.topBox').height() - $('.weui-menu').height());
    $(document).on('click', 'a', function (event) {

        if (window.parent){
             event.preventDefault();
             window.parent.parent.window.location = $(this).attr("href");
        }

    })

})